package net.skyaims.sqlmgr.domain;

import java.sql.ResultSet;
import java.sql.SQLException;

import lombok.Data;

import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

@Data
public class Idc implements ResultSetMapper<Idc> {

	private Integer seqid;
	private String uuid;
	private Integer id;
	private String name;
	private Integer netTypeId;
	private Integer liveCount = 0;

	private Integer statu;
	private Integer ptype;
	private Integer is_p2p;
	private Integer dyn_type;
	private Float dyn_low;
	private Float dyn_high;
	private Integer allow_check;
	private Integer is_random;
	private Integer bandwidth;
	private Integer value;

	private Integer def_weight;
	private String weight_table;

	// Transient---------------------------->>>
	private String netTypeName;
	private String str_statu;
	private String str_is_p2p;
	private String str_is_random;
	private String str_dyn_type;

	@Override
	public Idc map(int index, ResultSet r, StatementContext ctx) throws SQLException {
		Idc idc = new Idc();
		idc.setSeqid(r.getInt("seqid"));
		idc.setId(r.getInt("id"));
		idc.setUuid(r.getString("uuid"));
		return idc;
	}

}
